<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery-3.5.1.min.js"></script>
</head>
<body>
    <script>
        var todolist = [
            {
                title:'卢本伟牛逼',
                done:true,
            },
            {
                title:'卢本伟捞逼',
                done:false,
            }
        ];
        localStorage.setItem('todo',JSON.stringify(todolist));
        //本地存储只能保存字符串的数据格式，把数组对象转换成字符串格式 JSON.stringify()
        var data = localStorage.getItem('todo');
        console.log(typeof data);
        //获取本地存储的数据，需要把里面的字符串数据转换成对象格式 JSON.parse()
        data = JSON.parse(data);
        console.log(data);
    </script>
</body>
</html>